package com.tan.core.exception;

import com.tan.core.enums.ErrorEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Tan
 * @description
 * @date 2025/2/6
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SystemException extends RuntimeException{

    private ErrorEnum errorEnum;

    private String msg;

    public SystemException(ErrorEnum errorEnum){
        super(errorEnum.getMsg());
        this.errorEnum=errorEnum;
        this.msg=errorEnum.getMsg();
    }

    public SystemException(ErrorEnum errorEnum,String msg){
        super(msg);
        this.errorEnum=errorEnum;
        this.msg = msg;
    }

}
